{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1dcf7613",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/Users/TobiasWidmann/Documents/EUI - European University Institute/Papers/Emotional Dictionary/Political Analysis/Replication 2/replication_folder/electra\n"
     ]
    }
   ],
   "source": [
    "# Set working directory to the folder 'electra' which is located in the replication folder\n",
    "# %cd electra"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ce8c32d1-2b11-47f5-af78-63a5a18d13aa",
   "metadata": {},
   "source": [
    "To install all required packages listed in requirements.txt you can simply use the following pip-command: pip install -r requirements.txt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "cf55407a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import transformers\n",
    "import torch\n",
    "import sklearn\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "41c8323e-de7d-4f26-850a-ff937c6ee266",
   "metadata": {},
   "source": [
    "# Inferecing Test Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "61310d76",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>TextID</th>\n",
       "      <th>Text</th>\n",
       "      <th>Answer.1</th>\n",
       "      <th>Answer.2</th>\n",
       "      <th>Answer.3</th>\n",
       "      <th>Answer.4</th>\n",
       "      <th>h_anger</th>\n",
       "      <th>h_fear</th>\n",
       "      <th>h_disgust</th>\n",
       "      <th>...</th>\n",
       "      <th>hf_hope</th>\n",
       "      <th>df_hope</th>\n",
       "      <th>wb.anger</th>\n",
       "      <th>wb.fear</th>\n",
       "      <th>wb.disgust</th>\n",
       "      <th>wb.sadness</th>\n",
       "      <th>wb.joy</th>\n",
       "      <th>wb.enthusiasm</th>\n",
       "      <th>wb.pride</th>\n",
       "      <th>wb.hope</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>14</td>\n",
       "      <td>2019127_0016</td>\n",
       "      <td>sanktionen sind immer die schlechteste option ...</td>\n",
       "      <td>Ärger</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20</td>\n",
       "      <td>2019127_0022</td>\n",
       "      <td>fremdenfeindlichkeit rassismus hass und ressen...</td>\n",
       "      <td>Ärger</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>25</td>\n",
       "      <td>2019127_0026</td>\n",
       "      <td>das muss auch die ehemalige weinkönigin verstehen</td>\n",
       "      <td>Keine Emotion</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>28</td>\n",
       "      <td>2019127_0029</td>\n",
       "      <td>deshalb die linke wählen zb am 28</td>\n",
       "      <td>Keine Emotion</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>30</td>\n",
       "      <td>2019127_0031</td>\n",
       "      <td>die große koalition bringt nun einen antrag fü...</td>\n",
       "      <td>Keine Emotion</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>985</th>\n",
       "      <td>11003</td>\n",
       "      <td>2019127_9906</td>\n",
       "      <td>die betroffenen haben heute eine ähnliche lebe...</td>\n",
       "      <td>Stolz</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>986</th>\n",
       "      <td>11008</td>\n",
       "      <td>2019127_9911</td>\n",
       "      <td>da ist für die linke ganz klar durch kluge dip...</td>\n",
       "      <td>Hoffnung</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>987</th>\n",
       "      <td>11016</td>\n",
       "      <td>2019127_9918</td>\n",
       "      <td>da haben sie mich leider enttäuscht</td>\n",
       "      <td>Ärger</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>988</th>\n",
       "      <td>11027</td>\n",
       "      <td>2019127_9928</td>\n",
       "      <td>ich will es ganz deutlich sagen das gesamte ve...</td>\n",
       "      <td>Ärger</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>989</th>\n",
       "      <td>11086</td>\n",
       "      <td>2019127_9981</td>\n",
       "      <td>union und spd hatten den gesetzentwurf aber im...</td>\n",
       "      <td>Ärger</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>990 rows × 86 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Unnamed: 0        TextID  \\\n",
       "0            14  2019127_0016   \n",
       "1            20  2019127_0022   \n",
       "2            25  2019127_0026   \n",
       "3            28  2019127_0029   \n",
       "4            30  2019127_0031   \n",
       "..          ...           ...   \n",
       "985       11003  2019127_9906   \n",
       "986       11008  2019127_9911   \n",
       "987       11016  2019127_9918   \n",
       "988       11027  2019127_9928   \n",
       "989       11086  2019127_9981   \n",
       "\n",
       "                                                  Text       Answer.1  \\\n",
       "0    sanktionen sind immer die schlechteste option ...          Ärger   \n",
       "1    fremdenfeindlichkeit rassismus hass und ressen...          Ärger   \n",
       "2    das muss auch die ehemalige weinkönigin verstehen  Keine Emotion   \n",
       "3                    deshalb die linke wählen zb am 28  Keine Emotion   \n",
       "4    die große koalition bringt nun einen antrag fü...  Keine Emotion   \n",
       "..                                                 ...            ...   \n",
       "985  die betroffenen haben heute eine ähnliche lebe...          Stolz   \n",
       "986  da ist für die linke ganz klar durch kluge dip...       Hoffnung   \n",
       "987                da haben sie mich leider enttäuscht          Ärger   \n",
       "988  ich will es ganz deutlich sagen das gesamte ve...          Ärger   \n",
       "989  union und spd hatten den gesetzentwurf aber im...          Ärger   \n",
       "\n",
       "    Answer.2 Answer.3  Answer.4  h_anger  h_fear  h_disgust  ...  hf_hope  \\\n",
       "0        NaN      NaN       NaN        2       0          0  ...        0   \n",
       "1        NaN      NaN       NaN        3       0          1  ...        0   \n",
       "2        NaN      NaN       NaN        1       0          0  ...        0   \n",
       "3        NaN      NaN       NaN        0       0          0  ...        1   \n",
       "4        NaN      NaN       NaN        0       0          0  ...        0   \n",
       "..       ...      ...       ...      ...     ...        ...  ...      ...   \n",
       "985      NaN      NaN       NaN        0       0          0  ...        1   \n",
       "986      NaN      NaN       NaN        0       0          0  ...        1   \n",
       "987      NaN      NaN       NaN        2       0          0  ...        0   \n",
       "988      NaN      NaN       NaN        5       0          0  ...        0   \n",
       "989      NaN      NaN       NaN        4       0          0  ...        0   \n",
       "\n",
       "     df_hope  wb.anger  wb.fear  wb.disgust  wb.sadness  wb.joy wb.enthusiasm  \\\n",
       "0          0         1        1           0           0       0             0   \n",
       "1          0         1        1           1           0       0             0   \n",
       "2          0         0        0           0           0       0             0   \n",
       "3          0         0        0           0           0       0             0   \n",
       "4          0         0        0           0           0       0             0   \n",
       "..       ...       ...      ...         ...         ...     ...           ...   \n",
       "985        1         0        0           0           0       0             0   \n",
       "986        0         0        0           0           0       0             1   \n",
       "987        0         0        0           0           1       0             0   \n",
       "988        0         1        0           0           0       0             0   \n",
       "989        0         1        0           0           1       0             0   \n",
       "\n",
       "    wb.pride wb.hope  \n",
       "0          0       0  \n",
       "1          0       0  \n",
       "2          0       0  \n",
       "3          0       0  \n",
       "4          0       0  \n",
       "..       ...     ...  \n",
       "985        0       0  \n",
       "986        1       0  \n",
       "987        0       0  \n",
       "988        0       0  \n",
       "989        0       0  \n",
       "\n",
       "[990 rows x 86 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Load in data \n",
    "df_test = pd.read_csv('./electra.csv')  \n",
    "documents = list(df_test.Text)\n",
    "df_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d5052e91",
   "metadata": {},
   "outputs": [],
   "source": [
    "from helper.inferencing import Inferencer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "615ff91d",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Predicting\n",
    "predictor = Inferencer()\n",
    "df = predictor.predict_dataframe(documents)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "85b19294",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>text</th>\n",
       "      <th>anger</th>\n",
       "      <th>fear</th>\n",
       "      <th>disgust</th>\n",
       "      <th>sadness</th>\n",
       "      <th>joy</th>\n",
       "      <th>enthusiasm</th>\n",
       "      <th>pride</th>\n",
       "      <th>hope</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>sanktionen sind immer die schlechteste option ...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>fremdenfeindlichkeit rassismus hass und ressen...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>das muss auch die ehemalige weinkönigin verstehen</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>deshalb die linke wählen zb am 28</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>die große koalition bringt nun einen antrag fü...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>985</th>\n",
       "      <td>die betroffenen haben heute eine ähnliche lebe...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>986</th>\n",
       "      <td>da ist für die linke ganz klar durch kluge dip...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>987</th>\n",
       "      <td>da haben sie mich leider enttäuscht</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>988</th>\n",
       "      <td>ich will es ganz deutlich sagen das gesamte ve...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>989</th>\n",
       "      <td>union und spd hatten den gesetzentwurf aber im...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>990 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  text  anger  fear  disgust  \\\n",
       "0    sanktionen sind immer die schlechteste option ...    1.0   1.0      0.0   \n",
       "1    fremdenfeindlichkeit rassismus hass und ressen...    1.0   1.0      1.0   \n",
       "2    das muss auch die ehemalige weinkönigin verstehen    0.0   0.0      0.0   \n",
       "3                    deshalb die linke wählen zb am 28    0.0   0.0      0.0   \n",
       "4    die große koalition bringt nun einen antrag fü...    0.0   0.0      0.0   \n",
       "..                                                 ...    ...   ...      ...   \n",
       "985  die betroffenen haben heute eine ähnliche lebe...    0.0   0.0      0.0   \n",
       "986  da ist für die linke ganz klar durch kluge dip...    0.0   0.0      0.0   \n",
       "987                da haben sie mich leider enttäuscht    1.0   0.0      0.0   \n",
       "988  ich will es ganz deutlich sagen das gesamte ve...    1.0   0.0      0.0   \n",
       "989  union und spd hatten den gesetzentwurf aber im...    1.0   0.0      0.0   \n",
       "\n",
       "     sadness  joy  enthusiasm  pride  hope  \n",
       "0        0.0  0.0         0.0    0.0   0.0  \n",
       "1        1.0  0.0         0.0    0.0   0.0  \n",
       "2        0.0  0.0         0.0    0.0   0.0  \n",
       "3        0.0  0.0         0.0    0.0   0.0  \n",
       "4        0.0  1.0         0.0    1.0   0.0  \n",
       "..       ...  ...         ...    ...   ...  \n",
       "985      0.0  1.0         0.0    1.0   0.0  \n",
       "986      0.0  0.0         1.0    1.0   0.0  \n",
       "987      1.0  0.0         0.0    0.0   0.0  \n",
       "988      0.0  0.0         0.0    0.0   0.0  \n",
       "989      1.0  0.0         0.0    0.0   0.0  \n",
       "\n",
       "[990 rows x 9 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Show results\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "eac44d08-2612-4699-a06d-ee78e77359d9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Save results as .csv file to transfer to R\n",
    "df.to_csv('./electra_results.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cc4fa837-235f-485a-9046-147cff7b4f5a",
   "metadata": {
    "tags": []
   },
   "source": [
    "# Inferecing Additionally Labeled Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "f848e290-b288-4c62-8df3-4e516818941b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>TextID</th>\n",
       "      <th>Text</th>\n",
       "      <th>Answer.1</th>\n",
       "      <th>Answer.2</th>\n",
       "      <th>Answer.3</th>\n",
       "      <th>Answer.4</th>\n",
       "      <th>h_anger</th>\n",
       "      <th>h_fear</th>\n",
       "      <th>h_disgust</th>\n",
       "      <th>...</th>\n",
       "      <th>wb.hope</th>\n",
       "      <th>affect</th>\n",
       "      <th>posemo</th>\n",
       "      <th>negemo</th>\n",
       "      <th>liwc.fear</th>\n",
       "      <th>liwc.anger</th>\n",
       "      <th>liwc.sad</th>\n",
       "      <th>liwc.anger.norm</th>\n",
       "      <th>liwc.fear.norm</th>\n",
       "      <th>liwc.sad.norm</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>20210517_00008</td>\n",
       "      <td>In der kommenden Sitzungswoche thematisiert de...</td>\n",
       "      <td>Keine Emotion</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>5,56</td>\n",
       "      <td>0,00</td>\n",
       "      <td>5,56</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5.56</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.148267</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>20210517_00001</td>\n",
       "      <td>Und wie hoch ist das Taschengeld Ihrer Kinder?</td>\n",
       "      <td>Keine Emotion</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>20210517_00002</td>\n",
       "      <td>Wir bleiben dabei – wir wollen den Solidarität...</td>\n",
       "      <td>Enthusiasmus</td>\n",
       "      <td>Hoffnung</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>20210517_00007</td>\n",
       "      <td>Erst im Dezember votierte er mit seinen Mitgen...</td>\n",
       "      <td>Ärger</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>4,17</td>\n",
       "      <td>0,00</td>\n",
       "      <td>4,17</td>\n",
       "      <td>4.17</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.145957</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>20210517_00006</td>\n",
       "      <td>Sie schöpft und bewegt riesen Summen  noch wei...</td>\n",
       "      <td>Keine Emotion</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>11,11</td>\n",
       "      <td>11,11</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9995</th>\n",
       "      <td>83281</td>\n",
       "      <td>20210517_09998</td>\n",
       "      <td>Der Schutz der Seeverbindung für humanitäre Hi...</td>\n",
       "      <td>Hoffnung</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>11,76</td>\n",
       "      <td>11,76</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9996</th>\n",
       "      <td>83282</td>\n",
       "      <td>20210517_09997</td>\n",
       "      <td>Ich weiß gar nicht, wie viele Zeugen wir da ve...</td>\n",
       "      <td>Keine Emotion</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9997</th>\n",
       "      <td>83284</td>\n",
       "      <td>20210517_09996</td>\n",
       "      <td>Wer will, dass sich etwas bewegt, der muss Fre...</td>\n",
       "      <td>Keine Emotion</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>10,00</td>\n",
       "      <td>10,00</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9998</th>\n",
       "      <td>83285</td>\n",
       "      <td>20210517_10000</td>\n",
       "      <td>Deshalb ist eine verlässliche und neutrale Ver...</td>\n",
       "      <td>Enthusiasmus</td>\n",
       "      <td>Hoffnung</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>11,11</td>\n",
       "      <td>11,11</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9999</th>\n",
       "      <td>83286</td>\n",
       "      <td>20210517_09999</td>\n",
       "      <td>Ich will Ihnen aber auch sagen: Das Argument „...</td>\n",
       "      <td>Ärger</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>6,25</td>\n",
       "      <td>6,25</td>\n",
       "      <td>0,00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10000 rows × 60 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      Unnamed: 0          TextID  \\\n",
       "0              1  20210517_00008   \n",
       "1              2  20210517_00001   \n",
       "2              3  20210517_00002   \n",
       "3              4  20210517_00007   \n",
       "4              5  20210517_00006   \n",
       "...          ...             ...   \n",
       "9995       83281  20210517_09998   \n",
       "9996       83282  20210517_09997   \n",
       "9997       83284  20210517_09996   \n",
       "9998       83285  20210517_10000   \n",
       "9999       83286  20210517_09999   \n",
       "\n",
       "                                                   Text       Answer.1  \\\n",
       "0     In der kommenden Sitzungswoche thematisiert de...  Keine Emotion   \n",
       "1        Und wie hoch ist das Taschengeld Ihrer Kinder?  Keine Emotion   \n",
       "2     Wir bleiben dabei – wir wollen den Solidarität...   Enthusiasmus   \n",
       "3     Erst im Dezember votierte er mit seinen Mitgen...          Ärger   \n",
       "4     Sie schöpft und bewegt riesen Summen  noch wei...  Keine Emotion   \n",
       "...                                                 ...            ...   \n",
       "9995  Der Schutz der Seeverbindung für humanitäre Hi...       Hoffnung   \n",
       "9996  Ich weiß gar nicht, wie viele Zeugen wir da ve...  Keine Emotion   \n",
       "9997  Wer will, dass sich etwas bewegt, der muss Fre...  Keine Emotion   \n",
       "9998  Deshalb ist eine verlässliche und neutrale Ver...   Enthusiasmus   \n",
       "9999  Ich will Ihnen aber auch sagen: Das Argument „...          Ärger   \n",
       "\n",
       "      Answer.2 Answer.3 Answer.4  h_anger  h_fear  h_disgust  ...  wb.hope  \\\n",
       "0          NaN      NaN      NaN        0       0          0  ...        0   \n",
       "1          NaN      NaN      NaN        0       0          0  ...        0   \n",
       "2     Hoffnung      NaN      NaN        0       0          0  ...        0   \n",
       "3          NaN      NaN      NaN        3       1          0  ...        0   \n",
       "4          NaN      NaN      NaN        0       0          0  ...        0   \n",
       "...        ...      ...      ...      ...     ...        ...  ...      ...   \n",
       "9995       NaN      NaN      NaN        0       0          0  ...        0   \n",
       "9996       NaN      NaN      NaN        2       0          0  ...        0   \n",
       "9997       NaN      NaN      NaN        0       0          0  ...        1   \n",
       "9998  Hoffnung      NaN      NaN        0       0          0  ...        1   \n",
       "9999       NaN      NaN      NaN        5       0          0  ...        0   \n",
       "\n",
       "      affect  posemo  negemo  liwc.fear  liwc.anger  liwc.sad liwc.anger.norm  \\\n",
       "0       5,56    0,00    5,56       0.00        5.56       0.0        0.148267   \n",
       "1       0,00    0,00    0,00       0.00        0.00       0.0        0.000000   \n",
       "2       0,00    0,00    0,00       0.00        0.00       0.0        0.000000   \n",
       "3       4,17    0,00    4,17       4.17        0.00       0.0        0.000000   \n",
       "4      11,11   11,11    0,00       0.00        0.00       0.0        0.000000   \n",
       "...      ...     ...     ...        ...         ...       ...             ...   \n",
       "9995   11,76   11,76    0,00       0.00        0.00       0.0        0.000000   \n",
       "9996    0,00    0,00    0,00       0.00        0.00       0.0        0.000000   \n",
       "9997   10,00   10,00    0,00       0.00        0.00       0.0        0.000000   \n",
       "9998   11,11   11,11    0,00       0.00        0.00       0.0        0.000000   \n",
       "9999    6,25    6,25    0,00       0.00        0.00       0.0        0.000000   \n",
       "\n",
       "     liwc.fear.norm liwc.sad.norm  \n",
       "0          0.000000           0.0  \n",
       "1          0.000000           0.0  \n",
       "2          0.000000           0.0  \n",
       "3          0.145957           0.0  \n",
       "4          0.000000           0.0  \n",
       "...             ...           ...  \n",
       "9995       0.000000           0.0  \n",
       "9996       0.000000           0.0  \n",
       "9997       0.000000           0.0  \n",
       "9998       0.000000           0.0  \n",
       "9999       0.000000           0.0  \n",
       "\n",
       "[10000 rows x 60 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_test2 = pd.read_csv('./electra2.csv')  \n",
    "documents2 = list(df_test2.Text)\n",
    "df_test2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "12bd7daa-07c5-4746-a7a4-9de6dc2552f3",
   "metadata": {},
   "outputs": [],
   "source": [
    "from helper.inferencing import Inferencer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "964c8180-5cfa-40ec-b1db-5f1b803d2e1b",
   "metadata": {},
   "outputs": [],
   "source": [
    "predictor = Inferencer()\n",
    "df2 = predictor.predict_dataframe(documents2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "94ee104a-9936-4683-8784-997f20a55e25",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>text</th>\n",
       "      <th>anger</th>\n",
       "      <th>fear</th>\n",
       "      <th>disgust</th>\n",
       "      <th>sadness</th>\n",
       "      <th>joy</th>\n",
       "      <th>enthusiasm</th>\n",
       "      <th>pride</th>\n",
       "      <th>hope</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>In der kommenden Sitzungswoche thematisiert de...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Und wie hoch ist das Taschengeld Ihrer Kinder?</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Wir bleiben dabei – wir wollen den Solidarität...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Erst im Dezember votierte er mit seinen Mitgen...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Sie schöpft und bewegt riesen Summen  noch wei...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9995</th>\n",
       "      <td>Der Schutz der Seeverbindung für humanitäre Hi...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9996</th>\n",
       "      <td>Ich weiß gar nicht, wie viele Zeugen wir da ve...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9997</th>\n",
       "      <td>Wer will, dass sich etwas bewegt, der muss Fre...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9998</th>\n",
       "      <td>Deshalb ist eine verlässliche und neutrale Ver...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9999</th>\n",
       "      <td>Ich will Ihnen aber auch sagen: Das Argument „...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10000 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                   text  anger  fear  disgust  \\\n",
       "0     In der kommenden Sitzungswoche thematisiert de...    0.0   0.0      0.0   \n",
       "1        Und wie hoch ist das Taschengeld Ihrer Kinder?    0.0   0.0      0.0   \n",
       "2     Wir bleiben dabei – wir wollen den Solidarität...    0.0   0.0      0.0   \n",
       "3     Erst im Dezember votierte er mit seinen Mitgen...    1.0   0.0      0.0   \n",
       "4     Sie schöpft und bewegt riesen Summen  noch wei...    1.0   0.0      0.0   \n",
       "...                                                 ...    ...   ...      ...   \n",
       "9995  Der Schutz der Seeverbindung für humanitäre Hi...    0.0   0.0      0.0   \n",
       "9996  Ich weiß gar nicht, wie viele Zeugen wir da ve...    0.0   0.0      0.0   \n",
       "9997  Wer will, dass sich etwas bewegt, der muss Fre...    0.0   0.0      0.0   \n",
       "9998  Deshalb ist eine verlässliche und neutrale Ver...    0.0   0.0      0.0   \n",
       "9999  Ich will Ihnen aber auch sagen: Das Argument „...    1.0   0.0      0.0   \n",
       "\n",
       "      sadness  joy  enthusiasm  pride  hope  \n",
       "0         1.0  0.0         0.0    0.0   0.0  \n",
       "1         0.0  0.0         0.0    0.0   0.0  \n",
       "2         0.0  0.0         1.0    0.0   1.0  \n",
       "3         1.0  0.0         0.0    0.0   0.0  \n",
       "4         0.0  0.0         0.0    0.0   0.0  \n",
       "...       ...  ...         ...    ...   ...  \n",
       "9995      0.0  0.0         0.0    0.0   1.0  \n",
       "9996      0.0  0.0         0.0    0.0   0.0  \n",
       "9997      0.0  0.0         1.0    0.0   1.0  \n",
       "9998      0.0  0.0         1.0    0.0   1.0  \n",
       "9999      0.0  0.0         0.0    0.0   0.0  \n",
       "\n",
       "[10000 rows x 9 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "a0297de7-6f72-4019-8a0b-c5bd51d231c3",
   "metadata": {},
   "outputs": [],
   "source": [
    "df2.to_csv('./electra_results2.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2c668026-f0c1-4312-b424-7f15d04f7884",
   "metadata": {},
   "source": [
    "# Inferecing Appendix M Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "353aaeab-08ab-486c-826d-79b894740864",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>name</th>\n",
       "      <th>date</th>\n",
       "      <th>party</th>\n",
       "      <th>populist</th>\n",
       "      <th>medium</th>\n",
       "      <th>country</th>\n",
       "      <th>date2</th>\n",
       "      <th>prr</th>\n",
       "      <th>gov</th>\n",
       "      <th>...</th>\n",
       "      <th>period</th>\n",
       "      <th>post</th>\n",
       "      <th>offacc</th>\n",
       "      <th>leader</th>\n",
       "      <th>twitter</th>\n",
       "      <th>text</th>\n",
       "      <th>sent.text</th>\n",
       "      <th>terms</th>\n",
       "      <th>stopwords</th>\n",
       "      <th>terms.raw</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>8134</td>\n",
       "      <td>AfD</td>\n",
       "      <td>2016-01-04</td>\n",
       "      <td>AfD</td>\n",
       "      <td>1</td>\n",
       "      <td>PR</td>\n",
       "      <td>Germany</td>\n",
       "      <td>16804</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>pre</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>pazderski: frau von der leyen hängt ihr fähnle...</td>\n",
       "      <td>pazderski frau von der leyen hängt ihr fähnle...</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>8135</td>\n",
       "      <td>AfD</td>\n",
       "      <td>2016-01-04</td>\n",
       "      <td>AfD</td>\n",
       "      <td>1</td>\n",
       "      <td>PR</td>\n",
       "      <td>Germany</td>\n",
       "      <td>16804</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>pre</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>zur erklärung frau von der leyens, dass die fl...</td>\n",
       "      <td>zur erklärung frau von der leyens dass die fl...</td>\n",
       "      <td>25</td>\n",
       "      <td>2</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8136</td>\n",
       "      <td>AfD</td>\n",
       "      <td>2016-01-04</td>\n",
       "      <td>AfD</td>\n",
       "      <td>1</td>\n",
       "      <td>PR</td>\n",
       "      <td>Germany</td>\n",
       "      <td>16804</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>pre</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>noch im november hat frau von der leyen die fl...</td>\n",
       "      <td>noch im november hat frau von der leyen die f...</td>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>8137</td>\n",
       "      <td>AfD</td>\n",
       "      <td>2016-01-04</td>\n",
       "      <td>AfD</td>\n",
       "      <td>1</td>\n",
       "      <td>PR</td>\n",
       "      <td>Germany</td>\n",
       "      <td>16804</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>pre</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>nach knapp zwei monaten, nachdem nun auch der ...</td>\n",
       "      <td>nach knapp zwei monaten nachdem nun auch der ...</td>\n",
       "      <td>36</td>\n",
       "      <td>4</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>8138</td>\n",
       "      <td>AfD</td>\n",
       "      <td>2016-01-04</td>\n",
       "      <td>AfD</td>\n",
       "      <td>1</td>\n",
       "      <td>PR</td>\n",
       "      <td>Germany</td>\n",
       "      <td>16804</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>pre</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>das ist ein opportunistischer zick-zack-kurs.b...</td>\n",
       "      <td>das ist ein opportunistischer zickzackkursber...</td>\n",
       "      <td>33</td>\n",
       "      <td>6</td>\n",
       "      <td>39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168344</th>\n",
       "      <td>978130</td>\n",
       "      <td>SPD Fraktion</td>\n",
       "      <td>2018-10-15</td>\n",
       "      <td>SPD</td>\n",
       "      <td>0</td>\n",
       "      <td>PR</td>\n",
       "      <td>Germany</td>\n",
       "      <td>17819</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>pre</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>damit wirken wir steuerausfällen entgegen und ...</td>\n",
       "      <td>damit wirken wir steuerausfällen entgegen und...</td>\n",
       "      <td>21</td>\n",
       "      <td>3</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168345</th>\n",
       "      <td>978131</td>\n",
       "      <td>SPD Fraktion</td>\n",
       "      <td>2018-10-15</td>\n",
       "      <td>SPD</td>\n",
       "      <td>0</td>\n",
       "      <td>PR</td>\n",
       "      <td>Germany</td>\n",
       "      <td>17819</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>pre</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>steuerpflichtige sollen die private nutzung ei...</td>\n",
       "      <td>steuerpflichtige sollen die private nutzung e...</td>\n",
       "      <td>18</td>\n",
       "      <td>4</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168346</th>\n",
       "      <td>978132</td>\n",
       "      <td>SPD Fraktion</td>\n",
       "      <td>2018-10-15</td>\n",
       "      <td>SPD</td>\n",
       "      <td>0</td>\n",
       "      <td>PR</td>\n",
       "      <td>Germany</td>\n",
       "      <td>17819</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>pre</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>die neue steuerliche förderung soll auf fahrze...</td>\n",
       "      <td>die neue steuerliche förderung soll auf fahrz...</td>\n",
       "      <td>12</td>\n",
       "      <td>2</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168347</th>\n",
       "      <td>978133</td>\n",
       "      <td>SPD Fraktion</td>\n",
       "      <td>2018-10-15</td>\n",
       "      <td>SPD</td>\n",
       "      <td>0</td>\n",
       "      <td>PR</td>\n",
       "      <td>Germany</td>\n",
       "      <td>17819</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>pre</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>dezember 2021 angeschafft werden.</td>\n",
       "      <td>dezember 2021 angeschafft werden</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168348</th>\n",
       "      <td>978134</td>\n",
       "      <td>SPD Fraktion</td>\n",
       "      <td>2018-10-15</td>\n",
       "      <td>SPD</td>\n",
       "      <td>0</td>\n",
       "      <td>PR</td>\n",
       "      <td>Germany</td>\n",
       "      <td>17819</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>pre</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>für vor und nach diesem zeitraum angeschaffte ...</td>\n",
       "      <td>für vor und nach diesem zeitraum angeschaffte...</td>\n",
       "      <td>19</td>\n",
       "      <td>3</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>168349 rows × 22 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Unnamed: 0          name        date party  populist medium  country  \\\n",
       "0             8134           AfD  2016-01-04   AfD         1     PR  Germany   \n",
       "1             8135           AfD  2016-01-04   AfD         1     PR  Germany   \n",
       "2             8136           AfD  2016-01-04   AfD         1     PR  Germany   \n",
       "3             8137           AfD  2016-01-04   AfD         1     PR  Germany   \n",
       "4             8138           AfD  2016-01-04   AfD         1     PR  Germany   \n",
       "...            ...           ...         ...   ...       ...    ...      ...   \n",
       "168344      978130  SPD Fraktion  2018-10-15   SPD         0     PR  Germany   \n",
       "168345      978131  SPD Fraktion  2018-10-15   SPD         0     PR  Germany   \n",
       "168346      978132  SPD Fraktion  2018-10-15   SPD         0     PR  Germany   \n",
       "168347      978133  SPD Fraktion  2018-10-15   SPD         0     PR  Germany   \n",
       "168348      978134  SPD Fraktion  2018-10-15   SPD         0     PR  Germany   \n",
       "\n",
       "        date2  prr  gov  ...  period  post offacc  leader  twitter  \\\n",
       "0       16804    1    0  ...     pre     0      0       0        0   \n",
       "1       16804    1    0  ...     pre     0      0       0        0   \n",
       "2       16804    1    0  ...     pre     0      0       0        0   \n",
       "3       16804    1    0  ...     pre     0      0       0        0   \n",
       "4       16804    1    0  ...     pre     0      0       0        0   \n",
       "...       ...  ...  ...  ...     ...   ...    ...     ...      ...   \n",
       "168344  17819    0    1  ...     pre     1      0       0        0   \n",
       "168345  17819    0    1  ...     pre     1      0       0        0   \n",
       "168346  17819    0    1  ...     pre     1      0       0        0   \n",
       "168347  17819    0    1  ...     pre     1      0       0        0   \n",
       "168348  17819    0    1  ...     pre     1      0       0        0   \n",
       "\n",
       "                                                     text  \\\n",
       "0       pazderski: frau von der leyen hängt ihr fähnle...   \n",
       "1       zur erklärung frau von der leyens, dass die fl...   \n",
       "2       noch im november hat frau von der leyen die fl...   \n",
       "3       nach knapp zwei monaten, nachdem nun auch der ...   \n",
       "4       das ist ein opportunistischer zick-zack-kurs.b...   \n",
       "...                                                   ...   \n",
       "168344  damit wirken wir steuerausfällen entgegen und ...   \n",
       "168345  steuerpflichtige sollen die private nutzung ei...   \n",
       "168346  die neue steuerliche förderung soll auf fahrze...   \n",
       "168347                  dezember 2021 angeschafft werden.   \n",
       "168348  für vor und nach diesem zeitraum angeschaffte ...   \n",
       "\n",
       "                                                sent.text terms stopwords  \\\n",
       "0        pazderski frau von der leyen hängt ihr fähnle...    12         1   \n",
       "1        zur erklärung frau von der leyens dass die fl...    25         2   \n",
       "2        noch im november hat frau von der leyen die f...    14         1   \n",
       "3        nach knapp zwei monaten nachdem nun auch der ...    36         4   \n",
       "4        das ist ein opportunistischer zickzackkursber...    33         6   \n",
       "...                                                   ...   ...       ...   \n",
       "168344   damit wirken wir steuerausfällen entgegen und...    21         3   \n",
       "168345   steuerpflichtige sollen die private nutzung e...    18         4   \n",
       "168346   die neue steuerliche förderung soll auf fahrz...    12         2   \n",
       "168347                  dezember 2021 angeschafft werden      4         0   \n",
       "168348   für vor und nach diesem zeitraum angeschaffte...    19         3   \n",
       "\n",
       "        terms.raw  \n",
       "0              13  \n",
       "1              27  \n",
       "2              15  \n",
       "3              40  \n",
       "4              39  \n",
       "...           ...  \n",
       "168344         24  \n",
       "168345         22  \n",
       "168346         14  \n",
       "168347          4  \n",
       "168348         22  \n",
       "\n",
       "[168349 rows x 22 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_appm = pd.read_csv('./electra_appendixm.csv')  \n",
    "documents3 = list(df_appm.text)\n",
    "df_appm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "5b481d9f-37db-4863-9150-811918ce38bc",
   "metadata": {},
   "outputs": [],
   "source": [
    "from helper.inferencing import Inferencer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "f16040d1-17d1-4927-b55c-5a96d1ee6730",
   "metadata": {},
   "outputs": [],
   "source": [
    "predictor = Inferencer()\n",
    "df3 = predictor.predict_dataframe(documents3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "8a62bae4-7210-473c-b93f-b76d15ea88fb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>text</th>\n",
       "      <th>anger</th>\n",
       "      <th>fear</th>\n",
       "      <th>disgust</th>\n",
       "      <th>sadness</th>\n",
       "      <th>joy</th>\n",
       "      <th>enthusiasm</th>\n",
       "      <th>pride</th>\n",
       "      <th>hope</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>pazderski: frau von der leyen hängt ihr fähnle...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>zur erklärung frau von der leyens, dass die fl...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>noch im november hat frau von der leyen die fl...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>nach knapp zwei monaten, nachdem nun auch der ...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>das ist ein opportunistischer zick-zack-kurs.b...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168344</th>\n",
       "      <td>damit wirken wir steuerausfällen entgegen und ...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168345</th>\n",
       "      <td>steuerpflichtige sollen die private nutzung ei...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168346</th>\n",
       "      <td>die neue steuerliche förderung soll auf fahrze...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168347</th>\n",
       "      <td>dezember 2021 angeschafft werden.</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168348</th>\n",
       "      <td>für vor und nach diesem zeitraum angeschaffte ...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>168349 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                     text  anger  fear  \\\n",
       "0       pazderski: frau von der leyen hängt ihr fähnle...    1.0   0.0   \n",
       "1       zur erklärung frau von der leyens, dass die fl...    1.0   0.0   \n",
       "2       noch im november hat frau von der leyen die fl...    0.0   0.0   \n",
       "3       nach knapp zwei monaten, nachdem nun auch der ...    1.0   0.0   \n",
       "4       das ist ein opportunistischer zick-zack-kurs.b...    1.0   0.0   \n",
       "...                                                   ...    ...   ...   \n",
       "168344  damit wirken wir steuerausfällen entgegen und ...    0.0   0.0   \n",
       "168345  steuerpflichtige sollen die private nutzung ei...    1.0   0.0   \n",
       "168346  die neue steuerliche förderung soll auf fahrze...    0.0   0.0   \n",
       "168347                  dezember 2021 angeschafft werden.    0.0   0.0   \n",
       "168348  für vor und nach diesem zeitraum angeschaffte ...    0.0   0.0   \n",
       "\n",
       "        disgust  sadness  joy  enthusiasm  pride  hope  \n",
       "0           0.0      0.0  0.0         0.0    0.0   0.0  \n",
       "1           0.0      0.0  0.0         0.0    0.0   0.0  \n",
       "2           0.0      0.0  0.0         0.0    0.0   0.0  \n",
       "3           0.0      0.0  0.0         0.0    0.0   0.0  \n",
       "4           0.0      0.0  0.0         0.0    0.0   0.0  \n",
       "...         ...      ...  ...         ...    ...   ...  \n",
       "168344      0.0      0.0  0.0         1.0    1.0   1.0  \n",
       "168345      0.0      0.0  0.0         0.0    0.0   0.0  \n",
       "168346      0.0      0.0  1.0         0.0    0.0   1.0  \n",
       "168347      0.0      0.0  0.0         0.0    0.0   0.0  \n",
       "168348      0.0      0.0  0.0         0.0    0.0   0.0  \n",
       "\n",
       "[168349 rows x 9 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "04929271-e518-4418-a88e-deb376b8705b",
   "metadata": {},
   "outputs": [],
   "source": [
    "df3.to_csv('./electra_results_appendixm.csv')"
   ]
  }
 ],
 "metadata": {
  "environment": {
   "kernel": "python3",
   "name": "common-cu110.m87",
   "type": "gcloud",
   "uri": "gcr.io/deeplearning-platform-release/base-cu110:m87"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
